﻿@model UniTax.Models.TownList

<p>
    @Ajax.ActionLink("Добавить город", "TownCreate", null, new AjaxOptions
   {
       UpdateTargetId = "ajaxContainer",
       OnBegin = "showWaitDiv",
       OnSuccess = "hideWaitDiv"
   }, new { @class = "ico add" })
</p>
<table class="table hovertable" style="width: 100%">
    <tr>
        <th>Название</th>
        <th>Последнее обновление</th>
        <th style="width: 220px"></th>
    </tr>

    @foreach (var item in Model.Towns)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.LastUpd)
            </td>
            <td>
                @Ajax.ActionLink("Редактировать", "TownEdit", new { id = item.Id }, new AjaxOptions
   {
       UpdateTargetId = "ajaxContainer",
       OnBegin = "showWaitDiv",
       OnSuccess = "hideWaitDiv"
   }, new { @class = "ico edit" })
                @Ajax.ActionLink("Удалить", "TownDelete", new { id = item.Id }, new AjaxOptions
   {
       UpdateTargetId = "ajaxContainer",
       OnBegin = "showWaitDiv",
       OnSuccess = "hideWaitDiv"
   }, new { @class = "ico del" })
            </td>
        </tr>
    }

</table>

